<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/html" xml:lang="en" lang="en">
<head>
    <?php require'./phpScripts/validate.php' ?>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <meta name="description" content="" />
    <meta name="keywords" content="" />
    <meta name="author" content="" />
    <link rel="stylesheet" type="text/css" href="./Styles/style.css" media="screen" />
    <title>Student Survey</title>
</head>
<body>
    <div class="wrapper">
        <?php include('./includes/header.php'); ?>
        <?php include('./includes/nav.php'); ?>
<div class="content">
<!-- Make changes to content in this area -->
<?php include('/phpScripts/config.php') ?>
<?php
    $id = $_GET['ID'];
    $sql = "SELECT question_text, ROUND(CAST(question_sum AS DECIMAL)/question_count,2) AS avg FROM question WHERE survey_ID=$id";
     $data = mysql_query($sql) or die('Error completing query: ' . mysql_error());
 
 
 //print info to table
 Print "<table>"; 
 Print "<tr>"; 
 Print "<th>Question</th>"; 
 Print "<th>Average</th>";
 
 while($info = mysql_fetch_array($data)) 
 { 
 Print "<tr>"; 
 Print "<td>".$info['question_text'] . "</td> "; 
 Print "<td>".$info['avg'] . "</td></tr>"; 
 } 
 Print "</table>"; 
?>
<!-- End area for making changes -->
</div><!-- end #content -->
    <?php include('./includes/footer.php'); ?>
    </div><!-- end #wrapper -->
</body>
</html>








